//SamXIAO
#include <bits/stdc++.h>
using namespace std;
#define PI 3.1415926
#define   SQUARE(x) ((x)*(x))
//double SQUARE(double x) { return x*x;}
#define N_MAX 987654321
#define N_MIN -N_MAX
int f[286][102];

void w1()
{
	int n, m, x, y, ans=0;
	//scanf("%d", &n);
	//scanf("%d%d", &x, &y);
	n = 5;
	for(int i=1; i<=n; i++){
		for(int j=1; j<=n; j++)
			scanf("%d", &f[i][j]);
  }
	int col=0, row =0;
	for(int i=1; i<=n; i++){
		int ma = -99999999 ;
		for(int j=1; j<=n; j++){
		  if(ma < f[i][j]) {
				ma = f[i][j];
				col = j;
			}
		}
		
		int mi = 99999999;
		for(int j=1; j<=n; j++){
		  if(mi > f[j][col]) mi = f[j][col];
		}
		if(mi == ma){
			row = i;
			break;
		}
  }
	if(row && col) printf("%d %d %d", row, col , f[row][col]);
  else printf("not found");

}

int main()
{
	w1();
  return 0;
}
